package springmvc.output.config;

import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;

/**
 * description: SpringMvc的IOC容器初始化
 * 通过继承 AbstractAnnotationConfigDispatcherServletInitializer 实现
 *
 * 1. 指定配置文件
 * 2. 指定拦截路径
 */
public class SpringMVCInit extends AbstractAnnotationConfigDispatcherServletInitializer {

    @Override
    protected Class<?>[] getRootConfigClasses() {
        return new Class[0];
    }

    @Override
    protected Class<?>[] getServletConfigClasses() {
        return new Class[]{MvcConfig.class};
    }

    @Override
    protected String[] getServletMappings() {
        return new String[]{"/"};
    }
}
